package com.csdj.server.util;

import com.csdj.server.pojo.Admin;
import org.springframework.security.core.context.SecurityContextHolder;

/**
 * @Author zyq
 * @Date 2022/12/30 11:12
 * @ClassName: AdminUtils
 * @Description: TODO
 * @Version 1.0
 */
public class AdminUtils {

    public static Admin getCurrentAdmin(){

        return (Admin) SecurityContextHolder
                .getContext()
                .getAuthentication()
                .getPrincipal();
    }
}
